<?php
//ini_set('display_errors',1);
ini_set("soap.wsdl_cache_enabled", "0");
//include_once dirname(dirname(__FILE__)).'/utils.func.php';
//include_once dirname(__FILE__).'/init.php';
//CSPID MGTV
//SOPID NMQN
define('CSPID','MGTV');
define('LSPID','NMQN');
class nmgu_client{
	const WSDL = 'http://1.25.202.123/nn_mgtvbk/mgtv_v2/sp_nmgu/soap/nmgu_service.php?wsdl';

	static public function ContentPublishReq($CorrelateID,$CmdFileURL)
    {

		//$arg_list = func_get_args();
		//$CorrelateID = fjyd_guid_rand();
		//i_write_log('ExecCmd request args:'.var_export($arg_list,true),'c2');

        $client = self::get_soap_client();
        try
        {
        $ret = $client->ContentPublishReq(CSPID,LSPID,$CorrelateID,$CmdFileURL); 
        //写入日志
        i_write_log_core($client->__getLastRequest().'--'
        .$client->__getLastRequestHeaders().'--'
        .$client->__getLastResponse().'--'.$client->__getLastResponseHeaders(),'c2_soap');
        return $ret;
        }
        catch(Exception $e)
        {
		echo $client->__getLastRequest() , PHP_EOL;
		echo $client->__getLastRequestHeaders() , PHP_EOL;
		echo $client->__getLastResponse() , PHP_EOL;
		echo $client->__getLastResponseHeaders() , PHP_EOL;
		echo $e->getMessage();

	    }



		//i_write_log('ExecCmd return:'.var_export($ret,true),'c2');
		//i_write_log('LastRequest:'.$client->__getLastRequest());
		//i_write_log('LastResponse:'.$client->__getLastResponse());
		return $ret;
	}
	public static function get_soap_client(){
		return new SOAPClient(self::WSDL,array('trace'=>true));
	}
}


/*
$client = new fjyd_client();

$CmdFileURL='ftp://dfdfd';
$client->ExecCmd($CmdFileURL);

echo 'game over!';
*/
